Skip to main content

Data Modeling

supOS uses UNS (Unified Namespace) to organize data into a clear, tree-like structure. Each folder and file in the model automatically generates an MQTT topic, making it easy to get real-time data.

Things to Notice before Start

Page Overview

Select UNS > Namespace after logging in to supOS, you will see the main page of this module.

No.ItemDescription
1TopicTree view of data models already built in UNS
TemplateTree view of data model templates already built in UNS
LabelDisplays labels, and models under each label
2Displays data models by category: Text/Template/Label.
/Search data models / Refresh data model list.
/Create folder-file structured data models based on data hierarchy.
Create data models by manually entering JSON.
3Unmodeled TopicsLists the topics received in the internal broker, which can be transformed to data models. For details, see Building Models through MQTT.
4OverviewComprehensive view of existing folders and files, and the number of connections between data sources and the internal MQTT broker
5Topology MapVisualizes the data flow using a topology diagram
6Import/ExportImport/export data models in JSON or Excel format

Extra Parameter Definition

  • Path
ItemDescription
Extended AttributeAdd extended attributes for the path. Eg. unit.
TemplateSelect a template to inherit attributes from it. See Building Template.
Generate TemplateClick icon to add an attribute to the folder, at the same time you can select to generate a same template for future use.
  • Topic-Data Type
TypeDescription
Time SeriesReceive real-time data and store it in TDEngine.
RelationalReceive relational data and store it in a Postgres database.
CalculationPerform basic calculations on the added time series attributes.
AggregationAggregate the added data sources into JSON at a fixed frequency.
ReferenceSelect an existing file and copy its attributes.
  • Topic-Attribute Generation Method
Attribute Generation MethodDescription
CustomCustomize attributes.
TemplateInherit attributes from the selected template.
Reverse GenerationUse JSON text or connected databases to generate attributes with the same structure.
info

You can connect databases under DevTools > DBConnect. For details, see Database Connection.

  • Topic-Linked Operation
ItemDescription
PersistenceEnable historical data storage for the selected file.
Mock DataGenerates a data flow with mock data in UNS > Source Flow.
Auto-DashboardGenerates a dashboard in System > Dashboards.

How to Build a Data Model

Based on simple folder-file structure, you can define the data hierarchy to a tree map.

Building Models Manually

note

Factory/workshop/equipment/CNC will be used as an example, in which Factory, workshop and equipment are paths and CNC is a topic.

  1. Log in to supOS, and then select UNS > Namespace.
  2. Under Topic, click to add a path (e.g. factory).
  1. Select equipment, and then click to add a topic (e.g.CNC) under it.
  1. Enter the information of the topic, and then click Next.
  2. Select Enable History to store data to database, and then click Save.

Generating Models through JSON

  1. Log in to supOS, and then select UNS > Namespace.
  2. Click on the Topic page.
  1. Select the data type, and then write JSON text for the model according to the data tree structure.
{
"Factory1": {
"workshop1": {
"equipment1": {
"CNC1": [
{
"actualRuntime1": 1380,
"plannedRuntime1": 1440
}
]
}
}
}
}
  1. Click Next, and select the model on the left side.
tip

Click on each data level, you can change its information and add attributes on the right side.

  1. Click Save.

Converting Models through MQTT

  1. Use an MQTT client to connect to the internal broker of supOS-CE.
  • Host: Your supOS-CE domain.
  • Port: 1883.
  1. Define a topic and message payload on the client, and then send it to supOS.
  1. Log in to supOS, and then select UNS > Namespace.
  2. Expand Unmodeled Topics, find the topic you defined.
  3. Click Convert icon next to the topic, and then edit the information and complete the model creation.

Importing Models

  1. Log in to supOS, and then select UNS > Namespace.
  2. Click Import at the upper-right corner, and then click Download Template.
  1. Download the template and enter the model content according to template rules.
tip

You can manually add a path and topic, export it and use it as an example for import.

  • Through Excel File
  • Through JSON File
  1. Save the template file, and then click Import on the Namespace page.
  2. Select the template, and then click Save.

Creating Models with Data Source through Source Flow

  1. Log in to supOS, and then select UNS > Source Flow.

  2. Click New Source Flow to create a flow.

  3. Click the flow and drag the UNS Mapper node to the canvas.

  4. Double-click the node, and configure its properties.

    1. Set the node name, and then under Basic Info, select a protocol next to Select Protocol through which the data is transmitted.
    1. (Optional) Select a model next to Select Model to get an example for subsequent model attributes creation.
    2. Click Tags Mapping, click New Row, and then enter the model information.
    ParameterDescription
    FilePath (Required)Namespace topic path. Use folder/file style, only last level sends data. Example: Workshop1/Line2/CNC01/SpindleTemperature.
    Alias (Optional)Custom alias. If blank, system auto-generates unique ID.
    AttributeName (Required)Key name in output JSON (e.g., value).
    AttributeType (Required)Data type: Float, Integer, String, or Boolean. Node auto-converts.
    TagConfiguration (Required)Upstream data locator. Format depends on protocol: OPC UA (nodeId), Modbus (register index), MQTT (payload path), OPC DA (tag path).
  5. Complete the node configuration, and then connect a data source node (in this example, Modbus read) to the UNS Mapper and a mqtt out at the end.

  1. Edit properties of both the data source node and mqtt out node.
tip

For details on property configuration of common data source nodes, see Common Data Sources.

  1. Deploy the flow and trigger it, check the data on Namespace.

Optional Features

Building Template

  1. On the Namespace page, click Template.
  2. Click , and then enter the information of the template.
tip

Click Source to select added models and inherit their attributes.

  1. Click Save.

Creating Label

Labels are used for categorizing data models.

  1. On the Namespace page, click Label.
  2. Click , and then enter the label name.
  3. Click Save, and then click to add files under the label.
  1. Click Save.